<template>
  <div>
    <!-- 头部返回按钮 -->
     <div class="header">
          <div class="text" @click="okk">
          <i class="iconfont icon-back"></i>
          <span class="text1">
            <i class="iconfont icon-fanhui"></i>
             待上门
          </span>
       </div>
   </div>
      <!-- 医生介绍 -->
   <div class="nurse-info" @click="oldDetails(item)"  v-for="item in list" :key="item">
     <div class="left-tip">
        <div class="person">
            <div class="icon">
              <img class="avatar" :src="item.img">
            </div>
        </div>
        <div>
          <div class="nurse-name">{{item.user_name}}</div>
          <div class="nurse-bg">单号:{{item.my_order}}</div>
        </div>
    </div>
   </div>

  </div>
</template>

<script>
export default {
  data () {
    return {
      list: '',
      id: this.$store.getters['user/id'],
      imageUrl: this.$store.getters['user/img'] ? this.$store.getters['user/img'] : 'https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png'
    }
  },
  created () {
    this.getMessages()
  },
  methods: {
    getMessages () {
      const params = {
        id: this.id,
        status: 2
      }
      this.$http.post('/getMessages', params).then(res => {
        console.log(res.data)
        if (res.data.code === '1') {
          this.list = res.data.data
        }
      })
    },
    okk () {
      this.$router.go(-1)// 返回上一层
    },
    quit () {
      localStorage.removeItem('Token')
      this.$router.push({
        name: 'login'
      })
    },
    oldDetails (item) {
      this.$router.push({
        name: 'oldDetails',
        params: {
          orderId: item.my_order
        }
      })
    }
  }
}
</script>

<style scoped>
.header {
  height: 1.5rem;
  width: 100%;
  background:#96D596;
}
.text{
  padding-top:4%;
  font-size:0.55rem;
  color:white
}
.iconfont{
  font-size: 0.55rem;
}
.confirmButton{
  display: flex;
  justify-content: center;
  width:90%;
  margin: 0.5rem;
  background: #96D596;
  color:azure
}
.confirmButton .but{
  background: #96D596;
}
/* 护工的一个简短介绍 */
.nurse-info{
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom:1px solid #ccc
}
.nurse-info .edit-person-info{
  margin-right: 10%;
  font-size: 0.45rem;
}
.avatar {
    width:2rem;
    height: 2rem;
    border-radius: 50px;
    background: blanchedalmond;
    margin-right: 3%;
}
.left-tip .nurse-name{
  font-size: 0.5rem;
  margin-left:10px;
}
.left-tip .nurse-bg{
  font-size: 0.35rem;
  color: rgb(129, 121, 121);
  margin-left: 10px;
  margin-top:4px
}
.nurse-info .left-tip{
  display: flex;
  justify-content: center;
  align-items: center;
  margin:3% 5% 3% 3%;
}

</style>
